<template>
	<view style="width: 100%;">
		<view class="news-box" @click="itemClick(item)" v-for="(item,index) in info" :key="index">
			<view class="imgItem" v-if="item.newsCover && item.newsCover !== '' ">
				<!-- <image :src="item.newsCover && item.newsCover !== '' ? item.newsCover : '/static/img/home/news-1.png'" /> -->
				<!-- <image :src="item.newsCover" /> -->
				<image :src="$config.baseImgUrl+ item.newsCover"></image>
			</view>
			<view class="info">
				<view class="title text-white-space-line2">
					{{item.newsTitle}}
				</view>
				<view class="time">{{item.publishTime.substr(0,10)}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "news-item",
		props: ['info'],
		data() {
			return {}
		},
		mounted() {},
		methods: {
			itemClick(item) {
				this.$jump.toJump('pages/message/details?id=' + item.id)
			}
		}

	}
</script>

<style scoped lang="scss">
	.news-box {
		display: flex;
		align-items: center;
		border-radius: 10rpx;
		padding: 20rpx 0;
		border-bottom: 1rpx solid #c7c7c7;
		width: 100%;

		.imgItem {
			width: 180rpx;
			height: 150rpx;
		}

		image {
			width: 180rpx;
			height: 150rpx;
			// margin-bottom: 0;
			border-radius: $border-radius-lg;
		}

		.info {
			margin: 0rpx 0 0rpx 30rpx;
			flex: 1;
		}

		.title {
			align-items: center;
		}

		.time {
			margin-top: 0rpx;
			color: #ababab;
		}

		.view {
			display: flex;
			flex-direction: column;
			align-items: center;
			width: 100%;
			/* height: 100%; */
			background-color: rgba(255, 255, 255, 0.6);
			padding: 10rpx 0;
		}
	}

	.news-box:last-child {
		border-bottom: 0rpx solid #c7c7c7;
	}
</style>